﻿using System.Dynamic;
using Basic.FormModel.AgentForm;
using SqlSugar;
using WeDonekRpc.Model;
using WeDonekRpc.SqlSugar.VirtualQuery;

namespace Basic.FormDAL
{
    public interface IAgentFormDAL
    {
        ExpandoObject Get ( QueryStruct query );

        ExpandoObject Get ( string tableName, string[] cols, List<IConditionalModel> param );

        ExpandoObject Get ( string tableName, List<IConditionalModel> param );

        long Add ( string tableName, Dictionary<string, object> dic );

        void CreateTable ( string tableName, string show, AgentTableCol[] cols );

        ExpandoObject[] Gets ( string tableName, List<IConditionalModel> where, string[] cols );

        ExpandoObject[] Gets ( string tableName, List<IConditionalModel> where, List<SelectModel> selects );

        ExpandoObject Get ( string tableName, List<IConditionalModel> where, List<SelectModel> selects );

        ExpandoObject Get ( string tableName, List<IConditionalModel> where, params string[] col );
        Result[] Gets<Result> ( string tableName, List<IConditionalModel> where, string col );

        long Add ( TableAddData add );

        bool IsExists ( string table, List<IConditionalModel> where );

        ExpandoObject[] Query ( string tableName, List<IConditionalModel> where, string[] cols, IBasicPage paging, out int count );

        ExpandoObject[] Query ( string tableName, IBasicPage paging, out int count );

        ExpandoObject[] GroupBy ( string tableName, List<IConditionalModel> where, List<SelectModel> selects, List<GroupByModel> groupBy );
        ExpandoObject[] Gets ( QueryStruct query );
        ExpandoObject[] Query ( QueryStruct query, IBasicPage paging, out int count );
    }
}